﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HuiGuanTF2.aspx.cs" Inherits="Web.Pages.QuShui.DiXiaS.ShouFeiGL.HuiGuanTF2"  Theme="Default"%>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>回灌退费</title>
    <script src="../../../../JS/jquery.js" type="text/javascript"></script>
    <script src="../../../../JS/AddEditCancel.js" type="text/javascript"></script>
   <%-- <link href="../../../../css/inputBgColor.css" rel="stylesheet" />--%>
    <style type="text/css">
        body, html {
            padding: 0;
            margin: 0;
            font-size: 12px;
        }

        #img table tr td div {
            cursor: pointer;
        }
    </style>
    <script type="text/javascript">
        function display(op, id) {
            hdCollection.Set("ID", id);
            if (op == "add") {
                btnAdd.SetVisible(false);
                lblOperateTip.SetText("添加");
                listCover(true, "divList");
                $("#GridViewContentTable").show();
                cobGLDW.Focus();
            }
            else if (op == "edit") {
                btnAdd.SetVisible(false);
                lblOperateTip.SetText("修改");
                listCover(true, "divList");
                $("#GridViewContentTable").show();
                ASPxCallback1.PerformCallback("setinfo");
            }
            else {
                $("#GridViewContentTable").hide();
                btnAdd.SetVisible(true);
                listCover(false, "divList");
            }
        }

        function save() {
            //if (cobGLDW.GetText() == "") {
            //    alert("管理单位，不能为空！");
            //    cobGLDW.Focus();
            //    return;
            //}
            ASPxCallback1.PerformCallback("save");
        }

        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            if (type == "setinfo") {
                cobGLDW.SetText(arr[2]);
                txtHGH.SetText(arr[3]);
                txtHGJ.SetText(arr[4]);
                
                txtHGNL.SetText(arr[5]);
                txtXHGNL.SetText(arr[6]);
                txtCHHGNL.SetText(arr[7]);

                txtHGL.SetText(arr[8]);
                txtHGJH.SetText(arr[9]);
                txtHGDW.SetText(arr[10]);

                txtWTHGF.SetText(arr[11]);
                txtYTHGF.SetText(arr[12]);
                txtYTHGF2.SetText(arr[13]);
               
            }
            else if (type == "save") {
                display("init", -1);
                //记录当前操作对象,用于刷新列表后定位
               // hdCollection.Set("OperateID", specialIdentity);
                if (arr[2] == "1") {
                    alert("保存成功！");
                }
               
                gvList.PerformCallback();
               
            }
        }
        //function ChangeChild() {
        //    if (gvGridTab2.GetFocusedRowIndex() != -1) {
        //        hdCollection.Set("gvGrid2Tab2YHH", gvGridTab2.GetRowKey(gvGridTab2.GetFocusedRowIndex()));
        //        //loadpanel1.Show();
        //        gvGrid2Tab2.PerformCallback();
        //    }
        //}

        function begincall() {
            loadpanel1.Show();
        }
        function endcall() {
            loadpanel1.Hide();
            //定位添加或修改的记录
            var oid = hdCollection.Get("OperateID");
            var index = -1;
            if (oid != -1 && typeof (oid) != undefined) {
                for (var i = 0; i < gvList.GetVisibleRowsOnPage() ; i++) {
                    if (gvList.GetRowKey(i) == oid) {
                        index = i;
                    }
                }
                if (index != -1) {
                    gvList.SetFocusedRowIndex(index);
                    gvList.MakeRowVisible(index);
                    hdCollection.Set("OperateID", -1);
                }
            }
        }
    </script>
</head>
<body style="scroll:none">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            回灌退费
        </div>
        <div style="display: none;">
            <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
            <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
         <dx:ASPxLoadingPanel ID="ASPxLoadingPanel1" ClientInstanceName="loadpanel1" runat="server" ContainerElementID="gvList" Modal="true" Theme="Metropolis" ShowImage="false" Text="加载中" ></dx:ASPxLoadingPanel> 
        </div>

        <asp:UpdatePanel ID="updatePanel1" runat="server">
            <ContentTemplate>
                <div style="width:100%;">
                    <div>
                         <table style=" height: 35px">
                        <tr>

                            <td align="right" style="min-width: 80px">水量年：</td>
                            <td style="width: 150px">
                                <asp:Panel runat="server" ID="Panel7">
                                    <dx:ASPxComboBox runat="server" ID="cmbYear" Width="90%">
                                    </dx:ASPxComboBox>
                                </asp:Panel>
                            </td>
                           <%--  <td align="right" style="min-width: 80px">水量月：</td>
                            <td style="width: 150px">
                                <asp:Panel runat="server" ID="Panel71">
                                    <dx:ASPxComboBox runat="server" ID="cmbMonth" Width="90%">
                                    </dx:ASPxComboBox>
                                </asp:Panel>
                            </td> --%>

                            <td style="width: 80px">
                                <dx:ASPxLoadingPanel runat="server" ID="LoadPanel11" ClientInstanceName="LoadPanel" Text="正在查询"></dx:ASPxLoadingPanel>
                                <dx:ASPxButton runat="server" ID="btnChaXun" Text="查询" OnClick="btnChaXun_Click" UseSubmitBehavior="false">
                                    <ClientSideEvents Click="function(s,e){LoadPanel.Show();}" />
                                </dx:ASPxButton>

                            </td>
                            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <dx:ASPxButton ID="btnExport" runat="server" Text="导出EXCEL" OnClick="btnExportExcel_Click" UseSubmitBehavior="false">
                                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    </div>
                   

                    <div style="border: 1px solid #d0e4fe;">
                        <div id="img">
                            <table style="width:100%;">
                                <tr>
                                    <td style="width:50%;text-align:left;">
                                          <dx:ASPxButton ID="btnsx" Text="刷新" runat="server" OnClick="btnsx_Click" ></dx:ASPxButton> 
                                    </td>
                                    <td style="width:50%;text-align:right">
                                        <dx:ASPxLabel ID="zjl" Text="共0条" runat="server" ForeColor="Blue"></dx:ASPxLabel>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="divList">
                            <dx:ASPxGridView ID="gvList" SettingsBehavior-AllowSort="true" ClientInstanceName="gvList" runat="server" AutoGenerateColumns="False" KeyFieldName="ID"
                                ClientIDMode="AutoID"  Width="100%"  OnCustomCallback="gvList_CustomCallback" >
                                
                              
                                <Columns>
                                     <dx:GridViewDataTextColumn Width="40" FixedStyle="Left">
                                        <DataItemTemplate>
                                            <a href="#" onclick="display('edit','<%#Eval("ID")%>')">编辑</a>
                                        </DataItemTemplate>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="S_BUMENMC" Caption="管理单位" Width="100" HeaderStyle-HorizontalAlign="Center">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="S_YONGHUH" Caption="回灌户" Width="70" HeaderStyle-HorizontalAlign="Center">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="S_YONGHUM" Caption="户名" Width="100" FixedStyle="Left" HeaderStyle-HorizontalAlign="Center">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="S_JINGBH" Caption="回灌井" Width="70" HeaderStyle-HorizontalAlign="Center">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="S_JINGDIZ" Caption="井地址" Width="100" HeaderStyle-HorizontalAlign="Center">
                                    </dx:GridViewDataTextColumn>
                                    <%--<dx:GridViewDataTextColumn FieldName="I_NHGNL" Caption="年回灌能力(M³)" Width="100">
                                    </dx:GridViewDataTextColumn>--%>
                                    
                                    <dx:GridViewBandColumn Caption="回灌计划" HeaderStyle-HorizontalAlign="Center">
                                        <Columns>
                                            <dx:GridViewDataColumn FieldName="N_HUIGUANJH" Caption="万M³" Width="80" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataColumn>
                                        </Columns>
                                    </dx:GridViewBandColumn>
                                    <dx:GridViewBandColumn Caption="回灌单价" HeaderStyle-HorizontalAlign="Center">
                                        <Columns>
                                            <dx:GridViewDataColumn FieldName="N_HUIGUANDJ" Caption="元" Width="60" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataColumn>
                                        </Columns>
                                    </dx:GridViewBandColumn>
                                    <dx:GridViewBandColumn Caption="回灌量" HeaderStyle-HorizontalAlign="Center">
                                        <Columns>
                                            <dx:GridViewDataColumn FieldName="I_HUIGUANL" Caption="M³" Width="80" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataColumn>
                                        </Columns>
                                    </dx:GridViewBandColumn>
                                    <dx:GridViewBandColumn Caption="未退回灌水费" HeaderStyle-HorizontalAlign="Center">
                                        <Columns>
                                            <dx:GridViewDataColumn FieldName="N_TUIFEI_W" Caption="万元" Width="90" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataColumn>
                                        </Columns>
                                    </dx:GridViewBandColumn>
                                    <dx:GridViewBandColumn Caption="已退回灌水费" HeaderStyle-HorizontalAlign="Center">
                                        <Columns>
                                            <dx:GridViewDataColumn FieldName="N_TUIFEI_Y" Caption="万元" Width="90" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataColumn>
                                        </Columns>
                                    </dx:GridViewBandColumn>
                                    <dx:GridViewBandColumn Caption="预退回灌水费" HeaderStyle-HorizontalAlign="Center">
                                        <Columns>
                                            <dx:GridViewDataColumn FieldName="N_TUIFEI_Z" Caption="万元" Width="90" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataColumn>
                                        </Columns>
                                    </dx:GridViewBandColumn>
                                    <dx:GridViewBandColumn Caption="年回灌能力" HeaderStyle-HorizontalAlign="Center">
                                        <Columns>
                                            <dx:GridViewDataColumn FieldName="N_NHGNL" Caption="万M³/年" Width="90" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataColumn>
                                        </Columns>
                                    </dx:GridViewBandColumn>
                                    <dx:GridViewBandColumn Caption="现回灌能力" HeaderStyle-HorizontalAlign="Center">
                                        <Columns>
                                            <dx:GridViewDataColumn FieldName="N_XHGNL" Caption="M³/小时" Width="90" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataColumn>
                                        </Columns>
                                    </dx:GridViewBandColumn>
                                    <dx:GridViewBandColumn Caption="测试回灌能力" HeaderStyle-HorizontalAlign="Center">
                                        <Columns>
                                            <dx:GridViewDataColumn FieldName="N_CSHGNL" Caption="M³/小时" Width="90" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataColumn>
                                        </Columns>
                                    </dx:GridViewBandColumn>

                                    <%--<dx:GridViewDataTextColumn FieldName="I_HUIGUANJH" Caption="回灌计划(M³)" Width="100">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="N_HUIGUANDJ" Caption="回灌单价" Width="80">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="I_HUIGUANL" Caption="回灌量(M³)" Width="90">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="N_TUIFEI_W" Caption="未退回灌水费" Width="100">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="N_TUIFEI_Y" Caption="已退回灌水费" Width="100">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="N_TUIFEI_Z" Caption="预退回灌水费" Width="100">
                                    </dx:GridViewDataTextColumn>--%>
                                   
                                </Columns>
                                
                               <%-- <SettingsPopup>
                                    <HeaderFilter  Height="200" MinHeight="200"/>
                                </SettingsPopup>--%>
                                <Settings VerticalScrollBarMode="Visible" HorizontalScrollBarMode="Auto" VerticalScrollableHeight="300 " />
                                <SettingsPager Mode="EndlessPaging" PageSize="100" />
                                <Settings ShowFooter="True" />
                                <SettingsBehavior AllowFocusedRow="True"  ColumnResizeMode="Control" />
                                <SettingsBehavior ProcessFocusedRowChangedOnServer="False" />
                                <ClientSideEvents Init="function(s,e){AdjustSize(350,gvList);}" BeginCallback="function(s,e){begincall();}" EndCallback="function(s,e){endcall();}" />
                                <%--  BeginCallback="function(s,e){begincall();}" EndCallback="function(s,e){endcall();}" --%>
                            </dx:ASPxGridView>
                        </div>

                        <div>
                            <table>
                                <tr>
                                    <td style="width: 7%;"><span style="font-size: 12px;">年回灌能力：</span></td>
                                    <td><dx:ASPxTextBox runat="server" ID="txthe1" ClientEnabled="true" Width="90%" ClientInstanceName="txthe1"></dx:ASPxTextBox></td> 
                                     <td style="width: 7%;"><span style="font-size: 12px;">回灌计划：</span></td>
                                     <td><dx:ASPxTextBox runat="server" ID="txthe11" ClientEnabled="true" Width="90%" ClientInstanceName="txthe11"></dx:ASPxTextBox></td>   
                                        <td style="width: 7%;"><span style="font-size: 12px;">回灌量：</span></td>
                                     <td><dx:ASPxTextBox runat="server" ID="txthe2" ClientEnabled="true" Width="90%" ClientInstanceName="txthe2"></dx:ASPxTextBox></td>
                                        <td style="width: 7%;"><span style="font-size: 12px;">未退回灌水费：</span></td>
                                     <td><dx:ASPxTextBox runat="server" ID="txthe3" ClientEnabled="true" Width="90%" ClientInstanceName="txthe3"></dx:ASPxTextBox></td>
                                        <td style="width: 7%;"><span style="font-size: 12px;">已退回灌水费：</span></td>
                                     <td><dx:ASPxTextBox runat="server" ID="txthe4" ClientEnabled="true" Width="90%" ClientInstanceName="txthe4"></dx:ASPxTextBox></td>
                                        <td style="width: 7%;"><span style="font-size: 12px;">预退回灌水费：</span></td>
                                     <td><dx:ASPxTextBox runat="server" ID="txthe5" ClientEnabled="true" Width="90%" ClientInstanceName="txthe5"></dx:ASPxTextBox></td>  
                                </tr>
                            </table>
                        </div>
                          <div style="text-align: right">
                        <hr />
                        <dx:ASPxButton ID="btnAdd" ClientInstanceName="btnAdd" runat="server" Text="添加" AutoPostBack="false"  ClientSideEvents-Click="function(s,e){display('add',-1)}"  UseSubmitBehavior="false">
                        </dx:ASPxButton>
                    </div> 
                        <div id="GridViewContentTable" style="display: none;">
                            <div class="tabletitle1" align="center">
                                <dx:ASPxLabel ID="lblOperateTip" runat="server" ClientInstanceName="lblOperateTip" Text="添加"></dx:ASPxLabel>
                            </div>

                            <div>
                                <table style="text-align: right; width: 100%; height: 120px;">
                                    <tr>
                                        <td style="width: 100px;"><span style="font-size: 12px;">管理单位：</span></td>
                                        <td style="width:200px;">
                                             <asp:Panel runat="server" ID="Panel17">
                                    <dx:ASPxComboBox runat="server" ID="cobGLDW" Width="80%"  ClientInstanceName="cobGLDW" ValueType="System.String" EnableIncrementalFiltering="True"  DropDownStyle="DropDown">
                                    </dx:ASPxComboBox>
                                </asp:Panel> 
                                        </td>
                                        <td><span style="font-size: 12px;">回灌户：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGH" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGH"></dx:ASPxTextBox>
                                        </td>
                                        <td><span style="font-size: 12px;">回灌井：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGJ" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGJ"></dx:ASPxTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><span style="font-size: 12px;">年回灌能力：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGNL" ClientEnabled="false" Width="80%" ClientInstanceName="txtHGNL"></dx:ASPxTextBox>
                                        </td>
                                        <td style="width: 10%;"><span style="font-size: 12px;">现回灌能力：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtXHGNL" ClientEnabled="false" Width="80%" ClientInstanceName="txtXHGNL"></dx:ASPxTextBox>
                                        </td>
                                         <td><span style="font-size: 12px;">测试回灌能力：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtCHHGNL" ClientEnabled="true" Width="80%" ClientInstanceName="txtCHHGNL"></dx:ASPxTextBox>
                                        </td> 
                                    </tr>
                                    <tr>
                                        <td><span style="font-size: 12px;">回灌量：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGL" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGL"></dx:ASPxTextBox>
                                        </td>
                                          <td><span style="font-size: 12px;">回灌计划：</span></td>
                                        <td >
                                            <dx:ASPxTextBox runat="server" ID="txtHGJH" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGJH"></dx:ASPxTextBox>
                                        </td>
                                        <td><span style="font-size: 12px;">回灌单价：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGDW" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGDW"></dx:ASPxTextBox>
                                        </td> 
                                       
                                    </tr>
                                    <tr>
                                          <td><span style="font-size: 12px;">未退回灌费：</span></td>
                                        <td >
                                            <dx:ASPxTextBox runat="server" ID="txtWTHGF" ClientEnabled="true" Width="80%" ClientInstanceName="txtWTHGF"></dx:ASPxTextBox>
                                        </td>
                                          <td style="width: 10%;"><span style="font-size: 12px;">已退回灌费：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtYTHGF2" ClientEnabled="true" Width="80%" ClientInstanceName="txtYTHGF2"></dx:ASPxTextBox>
                                        </td>  
                                        <td style="width: 10%;"><span style="font-size: 12px;">预退回灌费：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtYTHGF" ClientEnabled="true" Width="80%" ClientInstanceName="txtYTHGF"></dx:ASPxTextBox>
                                        </td> 
                                    </tr>
                                   
                                </table>
                            </div>
                            <div style="text-align: right;">

                                <hr />
                                <dx:ASPxButton ID="btnSave" runat="server" Text="保存"  UseSubmitBehavior="false" ClientInstanceName="btnSave" AutoPostBack="false"  Visible="false">
                                    <ClientSideEvents Click="function(s,e) {save(); }" />
                                </dx:ASPxButton>
                                <dx:ASPxButton ID="btnCancel" runat="server" Text="放弃" UseSubmitBehavior="false" >
                                    <ClientSideEvents  Click="function(s,e){display('init',-1);}"/>
                                </dx:ASPxButton>
                            </div>
                        </div>
                    </div>

                </div>

            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
